package BinaryTree;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree =new BinaryTree();
        //BinaryTree.TreeNode root = binaryTree.creatTree();
        //注意这里给的字符串 一定是一个 合法的前序遍历的字符串
        String str ="ABC##DE#G##F###";
        BinaryTree .TreeNode root = binaryTree.createTree2( str);


        System.out.println("==========前序============");
        binaryTree.PreOder(root);
        System.out.println();
        System.out.println("==================中序=================");
        binaryTree.InOder(root);
        System.out.println();
        System.out.println("============后序=============");
        binaryTree.PostOder(root);
        System.out.println();
        System.out.println("====================层序=============");
        binaryTree.levelOrder(root);
        System.out.println();
       /* binaryTree.size(root);
        System.out.println("节点的个数："+BinaryTree.nodeSize);*/
        System.out.println("节点的个数："+binaryTree.size2(root));
        System.out.println("叶子节点的个数："+binaryTree.getLeafNodeCount2(root));
        System.out.println("第K层节点的个数："+binaryTree.getKLevelNodeCount(root,2));
        int ret =binaryTree.getHeight(root);
        System.out.println("树的高度为："+ret);



    }
}
